package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * Created by Administrator on 2016/6/14.
 */
public class QqLoginAction extends AHttpService<PbBean.PbResUserQqLogin> {

    private String openId;

    public static QqLoginAction newInstance(Context context, String openId) {
        return new QqLoginAction(context, openId);
    }

    private QqLoginAction(Context context, String openId) {
        super(context);
        this.openId = openId;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserQqLogin.Builder builder = PbBean.PbReqUserQqLogin.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setThirdId(openId);

        return apiService.qqLogin(builder.build());
    }
}
